package com.jx.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.jx.mapper.PhotoRecordMapper;
import com.jx.po.PhotoRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PhotoRecordService {

    @Value("${jyxm:B6}")
    private String jyxm;
    @Autowired
    private PhotoRecordMapper photoRecordMapper;

    public String getPhotoPath(String jylsh) {
        if (jylsh == null) {
            return null;
        }
        QueryWrapper wrapper = createWrapper();
        wrapper.eq("jylsh", jylsh);
        wrapper.eq("jyxm", jyxm);
        List<PhotoRecord> list = photoRecordMapper.selectList(wrapper);

        return list == null ? null : list.get(0).getZplj();

    }

    private QueryWrapper createWrapper() {
        QueryWrapper queryWrapper = new QueryWrapper();
        return queryWrapper;
    }
}
